import request from '@/utils/request'

export default {
  getLoginMenu() {
    return request('/menu');
    // return request.get('/rs/menu');
  },
  getMenuByUser(user_id) {
    return request.get('/menu', {
      params: {
        user_id: user_id
      }
    })
  },
  getMenuList(query) {
    return request.get('/menu/list', {
      params: {
        index: query.index,
        limit: query.limit
      }
    })
  },
  getParentMenuList() {
    return request.get('/menu/parent');
  },
  addMenu(menu) {
    return request.post('/menu/add', menu);
  },
  modifyMenu(menu) {
    return request.post('/menu/update', menu);
  },
  deleteMenu(menu_id) {
    return request.post('/menu/del', {
      menu_id: menu_id
    });
  },
  authMenu(admin_id, menu_ids) {
    return request.post('/menu/auth', {
      admin_id : admin_id,
      menu_ids: menu_ids
    });
  }
}